home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_02_04
/
2n04061a
< prev
next >
Wrap
Text File
|
1991-01-26
|
890b
|
41 lines
{ Demonstrates the use of function RdKey which is
assumed to be in a CrtExt.tpu which contains
your "extenders" for TP's Crt unit.
}
program DemoRdKey;
uses
crt, crtext;
var
QuickCh : char;
FullCh : keyrec;
begin
clrscr;
repeat
write('Press a key: ');
QuickCh := RdKey(FullCh);
writeln;
writeln;
writeln('Quickch (ReadKey''s ch) is ''',
QuickCh,''' with ascii ',ord(QuickCh));
writeln;
if ord(QuickCh) <> 0 then
begin
writeln('FullCh.ch is ''', Fullch.ch,'''',
' with ascii ',ord(FullCh.ch));
writeln('FullCh.sc is ', FullCh.sc,' (scan code)');
end
else
begin
writeln('FullCh.ch is ''', Fullch.ch,'''',
' with moved scan ',ord(FullCh.ch));
writeln('FullCh.sc is ', FullCh.sc,' (sp k flag)');
end;
writeln;
writeln;
until QuickCh = 'q'
end.